-
Notifications
You must be signed in to change notification settings - Fork 405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add MsgStoreCode and MsgInstantiateContract support to simulations #831
Conversation
Codecov Report
@@ Coverage Diff @@
## main #831 +/- ##
==========================================
+ Coverage 59.33% 59.34% +0.01%
==========================================
Files 51 51
Lines 5884 5886 +2
==========================================
+ Hits 3491 3493 +2
Misses 2142 2142
Partials 251 251
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯 Excellent. Happy to see this started!
var codeID uint64 | ||
wasmKeeper.IterateCodeInfos(ctx, func(u uint64, info types.CodeInfo) bool { | ||
if info.InstantiateConfig.Permission != types.AccessTypeEverybody { | ||
return false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, just take the next
}) | ||
|
||
if codeID == 0 { | ||
return simtypes.NoOpMsg(types.ModuleName, types.MsgInstantiateContract{}.Type(), "no codes with permission available"), nil, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
CodeID: codeID, | ||
Label: simtypes.RandStringOfLength(r, 10), | ||
Msg: []byte(`{}`), | ||
Funds: simtypes.RandSubsetCoins(r, spendable), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
) | ||
|
||
//go:embed testdata/reflect.wasm | ||
var reflectContract []byte |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to embed from the keeper testdata so that we do not have to maintain copies of the file?
See #797
Based on #825
Add support for:
MsgStoreCode
MsgInstantiateContract
Simulations can be run with
test-sim-multi-seed-short
andmake test-sim-import-export